Component({
  // 组件属性（外部传入）
  properties: {
    content: { type: String, value: '' },        
    confirmText: { type: String, value: '确定' },
    cancelText: { type: String, value: '取消' }  
  },

  data: {
    visible: false 
  },


  methods: {

    show() {
      this.setData({ visible: true });
    },


    hide() {
      this.setData({ visible: false });
    },


    onCancel() {
      this.hide();
      this.triggerEvent('cancel');
    },


    onConfirm() {
      this.hide();
      this.triggerEvent('confirm');
    }
  }
});